home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 26 / Mac Magazin and MacEasy Magazine CD - Issue 26.iso / Wissenschaft & Technik / TimGA 1.1 ƒ / More Documentation / Writing graph files < prev   
Text File  |  1996-08-17  |  2KB  |  68 lines

  1. _______________________________________________________________
  2. TimGA — A freeware Mac application
  3. Version 1.1 (August 1996)
  4.  
  5. By Timo Eloranta
  6. Copyright © 1995-96 Brown Eyes Software
  7. All rights reserved.
  8.  
  9. Internet e-mail:  timo.eloranta@ac.com        
  10. _______________________________________________________________
  11.  
  12. Writing graph files
  13.  
  14. This document explains how you can write new graph files for TimGA.
  15.  
  16. The files in the "Graphs" folder are actually ordinary TEXT files with
  17. creator type set to 'TiGA' (without this creator type the files wouldn't
  18. show up with the custom icon...). The easiest way of creating a new
  19. graph file with the correct creator type is duplicating one of the original
  20. graph files. (Duplication is done in the Finder by selecting the file to be
  21. duplicated and then choosing the Duplicate command from the File menu.)
  22.  
  23. You can open your new graph file with any text editor (for example 
  24. Apple's SimpleText). Here's an example of how a simple graph (a path
  25. with 5 nodes) might look like:
  26.  
  27. _________________
  28.  
  29. |V|:    5        // Number of nodes
  30. |E|:    4        // Number of edges
  31.  
  32.     1    2        // Edges are represented as pairs of node numbers...
  33.     2    3
  34.     3    4
  35.     4    5
  36.  
  37. ---
  38. This graph is a path.
  39. _________________
  40.  
  41. This example file has actually much more stuff in it than necessary,
  42. since TimGA ignores everything but the numbers !!!
  43.  
  44. Here are the things that really matter:
  45.  
  46.   •  The first number in the text should be the quantity of nodes 
  47.       in the graph (5 in this example).
  48.   •  The second number in the text should be the quantity of edges
  49.      in the graph (4 in this example).
  50.   •  After giving the node and edge quantities, you should list the
  51.       edges as pairs of nodes. If your graph is complex, it might be
  52.       a good idea to draw it first on paper. The nodes should be
  53.       numbered from 1 to |V|, where |V| means the quantity of nodes.
  54.       The order in which the edges are listed doesn't matter...
  55.       and neither does the order in which the nodes are given in
  56.       the pairs (In other words, the edges are undirected).
  57.  
  58. Both of the following mean just the same as the one above:
  59.  
  60.               5  4   5 4  4 3  3 2  2 1   
  61.        or    5  4   2 1  4 5  4 3  2 3.
  62.  
  63. That's it. When you're finished save your document with the name
  64. of your choice. You can now open the graph with TimGA.
  65.  
  66. If you have any problems, let me know. If your problems are not
  67. related to TimGA, I'm probably as clueless as you are... <grin>
  68.